from django.db import models
from django.utils import timezone
# Create your models here.


class Blog(models.Model):
    id = models.AutoField(primary_key=True, verbose_name="编号")
    name = models.CharField(max_length=1024, verbose_name="名称")
    url = models.CharField(max_length=2048, verbose_name="访问地址", default='/')
    path = models.CharField(max_length=2048, verbose_name="真实地址")
    md5 = models.CharField(max_length=1024, verbose_name="md5值")
    tag = models.CharField(max_length=1024, verbose_name="标签")
    show=models.BooleanField(verbose_name="是否展示",default=True)
    modified_time = models.DateTimeField(
        verbose_name='更新时间', default=timezone.now)

    class Meta:
        verbose_name = "博客"
        verbose_name_plural = "博客"  # 侧边栏

    def __str__(self):
        return str(self.name)
